import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/home',
        component: () => import("@/views/Index.vue")
    },
    {
        path: '/loginForm',
        component: () => import("@/views/LoginForm.vue")
    },
    {
        path:'/getBackPsw',
        component: () => import("@/views/GetBackPassword.vue")
    },
    {
        path: '/registe',
        component: () => import("@/views/Registe.vue")
    },
    {
        path: '/learning',
        component: () => import("@/views/HomePage/Learning.vue")
    },
    {
        path: '/main',
        component: () => import("@/views/HomePage/Base.vue"),
        redirect: '/main/study',
        children: [
            {
                path: 'study',
                component: () => import("@/views/HomePage/Study.vue"),
            },
            {
                path: 'comment',
                name: 'comment',
                component: () => import("@/views/HomePage/Comment.vue")
            },
            {
                path: 'share',
                component: () => import("@/views/HomePage/Share.vue"),
            },
            {
                path: 'personal',
                component: () => import("@/views/HomePage/Personal.vue"),
            },
            {
                path: 'settings',
                component: () => import("@/views/HomePage/Settings.vue")
            },
            {
                path: 'wordList',
                component: () => import("@/views/HomePage/WordList.vue")
            },
            {
                path: 'wordRecord',
                component: () => import("@/views/HomePage/WordRecord.vue")
            }

        ]
    },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
